﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using V5_BLL;
using V5_Common;

namespace V5_EShop.Controls
{
    public partial class getHotKeyList : BasicControl
    {
        string paramValue = "";

        public string ParamValue
        {
            get { return paramValue; }
            set { paramValue = value; }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                Bind_rpList();
            }
        }

        private void Bind_rpList()
        {
            Repeater rp = (Repeater)this.FindControl("rpList");
            if (rp != null)
            {
                int row = 0;
                string strWhere = " ", Where = "";
                if (ParamValue.Length > 0)
                {
                    row = Input.SetInt(Input.TagVal(ParamValue,"row"));
                    if (row < 1)
                    {
                        row = 10;
                    }
                    Where = Input.TagVal(ParamValue, "where");
                    if (Where != "")
                    {
                        strWhere += " " + Where;
                    }
                }
                DataTable dt = new BLLHotKeyWord().GetList(row,strWhere," ID ").Tables[0];
                rp.DataSource = dt;
                rp.DataBind();
            }
        }
    }
}